<form class="form form-horizontal"  >
    <div class="codeView docs-apply">
        <!--基本信息-->
        <dl class="permission-list" style="border: solid 0px #eee;">
            <dd>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">编号：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <label class="form-label l">{{$res['number']}}</label>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">项目名称：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <if condition="$res['status'] eq 5 or !in_array(DEPART,array(0,C('APPROVER')))">
                            <label class="form-label l">{{$res['apply_name']}}</label>
                            <else/>
                        <span  id="change_name"><input type="text" style="width:50%" class="input-text" placeholder="项目名称" id="apply_name" name="apply_name" value="{{$res['apply_name']}}" ></span>
                        <span style="color:blue;cursor: pointer;" title="修改" onclick="update_apply_name({{$res['id']}},this)">修改</span>
                        </if>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">项目分类：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <label class="form-label l">{{$res['project_name']}}</label>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">附件：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <label class="form-label l">
                            <a style="color: #063892;text-decoration: none" href="{{:U('Admin/Data/download',array('method'=>'apply','id'=>$res['id']))}}"  title="点击下载"><i class="Hui-iconfont">&#xe640;</i>{{$res['number']}}.{{:pathinfo($res['path'])['extension']}}</a>
                        </label>
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">材料寄送：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <div class="skin-minimal">
                            <switch name="res['is_deliver']">
                                <case value="1">
                                    <div class="check-box">
                                        <input type="checkbox" id="is_deliver-1" checked >
                                        <label for="is_deliver-1">是</label>
                                    </div>
                                </case>
                                <case value="2">
                                    <div class="check-box">
                                        <input type="checkbox" id="is_deliver-2" checked>
                                        <label for="is_deliver-2">否</label>
                                    </div>
                                </case>
                                <default/><label class="form-label l" style="color:red">异常选择</label>
                            </switch>
                        </div>
                    </div>
                </div>
                <if condition="$res['is_deliver'] eq 1">
                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-3">快递单号：</label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <label class="form-label l">{{$res['tracking_no']}}</label>
                        </div>
                    </div>
                </if>
            </dd>
        </dl>
        <!--主审单位-->
        <dl class="permission-list" >
            <dt>
                <label>主审单位</label>
            </dt>
            <dd style="background-color: #fffde4;">
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">主审单位：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <label class="form-label l">{{$res['company_name']}}</label>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">部门：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <label class="form-label l">{{$res['depart_name']}}</label>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">联系人：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <label class="form-label l">{{$res['contact']}}</label>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">职务：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <label class="form-label l">{{$res['position_name']}}</label>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">电话号码：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <label class="form-label l">{{$res['contact_phone']}}</label>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">邮寄地址：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <label class="form-label l">{{$res['contact_address']}}</label>
                    </div>
                </div>
            </dd>
        </dl>
        <!--现场勘测-->
        <dl class="permission-list" style="border: solid 0px #eee;">
            <dd>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">现场踏勘：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <div class="skin-minimal">
                            <switch name="res['need_survey']">
                                <case value="2">
                                    <div class="check-box">
                                        <input type="checkbox" id="need_survey-2" checked >
                                        <label for="need_survey-2">不需要</label>
                                    </div>
                                </case>
                                <case value="1">
                                    <div class="check-box">
                                        <input type="checkbox" id="need_survey-1" checked >
                                        <label for="need_survey-1">需要</label>
                                    </div>
                                </case>
                                <default/><label class="form-label l" style="color:red">异常选择</label>
                            </switch>
                        </div>
                    </div>
                </div>
                <if condition="$res['need_survey'] eq 1">
                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-3">时间：</label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <label class="form-label l">{{$res['survey_time']}}</label>
                        </div>
                    </div>
                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-3">踏勘地址：</label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <label class="form-label l">{{$res['survey_address']}}</label>
                        </div>
                    </div>
                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-3">联系人：</label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <label class="form-label l">{{$res['survey_contact']}}</label>
                        </div>
                    </div>
                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-3">注意事项：</label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <label class="form-label l">{{$res['survey_attention']}}</label>
                        </div>
                    </div>
                </if>
            </dd>
        </dl>
        <!--审批表格是否寄送-->
        <dl class="permission-list" style="border: solid 0px #eee;">
            <dd>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">最终审核意见是否寄送：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <div class="skin-minimal">
                            <switch name="res['need_deliver']">
                                <case value="2">
                                    <div class="check-box">
                                        <input type="checkbox" id="need_deliver-2" checked >
                                        <label for="need_deliver-2">否</label>
                                    </div>
                                </case>
                                <case value="1">
                                    <div class="check-box">
                                        <input type="checkbox" id="need_deliver-1" checked >
                                        <label for="need_deliver-1">是</label>
                                    </div>
                                </case>
                                <default/><label class="form-label l" style="color:red">异常选择</label>
                            </switch>
                        </div>
                    </div>
                </div>
                <if condition="$res['need_deliver'] eq 1">
                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-3">收件人姓名：</label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <label class="form-label l">{{$res['receiver_name']}}</label>
                        </div>
                    </div>
                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-3">收件地址：</label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <label class="form-label l">{{$res['receiver_address']}}</label>
                        </div>
                    </div>
                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-3">收件人电话：</label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <label class="form-label l">{{$res['receiver_phone']}}</label>
                        </div>
                    </div>
                </if>
            </dd>
        </dl>
        <!--基本信息-->
        <dl class="permission-list" style="border: solid 0px #eee;">
            <dd>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">申请人姓名：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <label class="form-label l">{{$res['submitter']}}</label>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">申请单位：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <label class="form-label l">{{$res['submitter_company']}}</label>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">验证手机：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <label class="form-label l">{{$res['validate_phone']}}</label>
                    </div>
                </div>
            </dd>
        </dl>

    </div>
</form>
<script type="text/javascript">
    function update_apply_name(id,obj){
        var apply_name = $("#apply_name").val();
        if(apply_name){
            $.ajax({
                type: 'POST',
                url: '{{:U("Admin/Apply/changeApplyName")}}',
                data: {
                    id : id,
                    apply_name:apply_name,
                },
                dataType: 'json',
                beforeSend:function(){
                    $(obj).hide();
                },
                success: function(data){
                    if(data.status){
                        layer.msg(data.info,{icon:1,time:1000});
                        $("#change_name").html('<label class="form-label l">'+apply_name+'</label>');
                    }else{
                        layer.msg(data.info,{icon:2,time:1000});
                        $(obj).show();
                    }
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        }else{
            layer.msg("请填写项目名称",{icon:2,time:1000});
        }
    }

</script>